pp108 : Creating a Custom Error

Creating a Custom Error

This topic describes the procedure to create a custom error.

Every method (SOAP request) can have its own error codes (SOAP faults). To model errors in a business process, the End event has to be configured in Properties - End Event pane, where the End Type property should be set as Error. The code for the error can be custom-defined or predefined. A process error can be used for exception handling when the process is used as a sub-process in another process. The sub-process can have a link to an exception handling event in the main process. Creating a custom error involves creating the custom error for a sub-process and mapping this to the custom error in the main process.

While creating a custom error, select an error code that is unique, and that does not match a predefined error code. If you do not select a unique error code, the predefined error code will be thrown.

  1. Double-click the End event in the Process Platform business process modeling environment. Alternatively, you can right-click the End event and select Properties from the menu. The End Event Properties - End pane appears. For more information refer to the End Event Configuration Interface.
  2. Click the General tab, enter a Description for the End event, and select Error from the End Type drop-down list.
  3. Click the Error details tab, enter the Error Code, Error Message and, Error Detail.

A custom error is created.

Example of Creating a Custom Error

In a business process, 'Get Employee details', the 'GetEmployee' activity fetches employee details from the database, and returns the 'First name' of the employee if it exists; else an exception is thrown.

If no value is found for the 'First name' of the employee, the process ends with an exception. The Properties - End Event pane for this example is shown below.

Type the description of the error in the Description field and select Error as the End Type.

In the Error Details tab, choose Static Value from the drop-downs, enter 101 in the text box next to Error Code, and enter 'First Name Not Present' in the text boxes next to Error Message and Error Details fields.

After you complete this task:
You must map the custom error to an Exception event in the main process.